<?php $uClass     = $sf_params->get('uClass') ?>
<?php $dbClass    = $sf_params->get('dbClass') ?>
<?php $stcClass   = $sf_params->get('stcClass') ?>
<?php $ns         = $sf_params->get('ns') ?>

<?php $bgcolor      = isset($bgcolor)      ? $bgcolor      : false ?>
<?php $main_colspan = isset($main_colspan) ? $main_colspan : 1 ?>

   <tr>
    <td valign="top" style="padding-top: 3px;" colspan="<?php echo $main_colspan ?>">
      <div class="" style="padding: 3px 7px 0px;">
       <?php if (has_slot('summary')): ?>
          <?php include_slot('summary') ?>
        <?php endif ?>
          
        <table width="100%" cellspacing="0" cellpadding="5" border="0">
          
          <tr>
            <td width="100%"><table width="100%" cellpadding="2" cellspacing="0" class="list">
                <colgroup>
                  <?php foreach ($fields as $field): ?>
                    <col width="<?php echo $field[0] ?>%">
                  <?php endforeach; ?>
                </colgroup>
                
                <tr style="height: 25px;" class="links">
                  <?php foreach ($fields as $field): ?>
                    <th nowrap align="<?php echo (isset($field[4])) ? $field[4] : 'left' ?>"><?php echo $field[2]  ?></th>
                  <?php endforeach; ?>
                </tr>
                
                <?php $count = 0; foreach ($objects as $obj): ?>
                  <tr <?php if ($bgcolor): ?>style="background-color: <?php echo $uClass == 'order' ? $obj->getTrackingNumberFilledColor() : $obj->getShipmentStatusColor() ?>"<?php endif; ?>>
                    <?php foreach ($fields as $field): ?>
                      <td nowrap align="<?php echo (isset($field[4])) ? $field[4] : 'left' ?>">
                        <?php if (in_array($field[1], array('order_status', 'payment_status'))): ?>
                          <div style="margin: 1px; padding: 2px; border: 1px solid #000000; font-weight: bold; color: <?php echo $field[1] == 'order_status' ? $obj->getOrderStatusColor() : $obj->getPaymentStatusColor() ?>;">
                        <?php endif; ?>
                        
                        <?php if ($field[3] == 'partial'): ?>
                          <?php include_partial(sprintf('%s/%s', $dbClass, $field[1]), array($uClass => $obj)) ?>
                        <?php else: ?>
                          <?php echo $field[3] ? ($obj->$field[3]() != '' ? $obj->$field[3]() : '&nbsp;') : '&nbsp;' ?> <?php //just in case ?>
                        <?php endif; ?>
                        
                        <?php if (in_array($field[1], array('order_status', 'payment_status'))): ?></div><?php endif; ?>                      </td>
                    <?php endforeach; ?>
                  </tr>
                <?php $count++; endforeach; ?>
              </table>
              
            <br/></td>
          </tr>
        </table>   
      </div>
    </td>
  </tr>
